home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-13 | 4.0 KB | 173 lines | [TEXT/EDIT] |
- diff -r lib_std/array.e /users/prof/colnet/SmallEiffel/lib_std/array.e
- 11,12c11
- < creation {ANY}
- < make
- ---
- > creation make
- 179a179
- > lower = old lower
- 184a185,186
- > local
- > i: INTEGER;
- 185a188,195
- > from
- > i := lower;
- > until
- > i = upper
- > loop
- > put(item(i+1),i);
- > i := i + 1;
- > end;
- 188a199
- > upper = old upper;
- diff -r lib_std/array.e /users/prof/colnet/SmallEiffel/lib_std/array.elib_std/double.e /users/prof/colnet/SmallEiffel/lib_std/double.e
- 153d152
- < str.extend('.');
- 155,164c154,166
- < from
- < invariant
- < d < 1;
- < until
- < d = 0.0
- < loop
- < d := d * 10.0;
- < i := d.floor;
- < d := d - i;
- < str.extend(i.digit);
- ---
- > if d /= 0.0 then
- > from
- > str.extend('.');
- > invariant
- > d < 1;
- > until
- > d = 0.0
- > loop
- > d := d * 10.0;
- > i := d.floor;
- > d := d - i;
- > str.extend(i.digit);
- > end;
- diff -r lib_std/double.e /users/prof/colnet/SmallEiffel/lib_std/double.elib_std/fixed_array.e /users/prof/colnet/SmallEiffel/lib_std/fixed_array.e
- 6,7c6,8
- < -- The `lower' bound is frozen. Thus, FIXED_ARRAY should
- < -- run a little bit faster than ARRAY.
- ---
- > -- Unlike ARRAY, the `lower' bound of a FIXED_ARRAY is
- > -- frozen (to 0). Thus, when looping toward 0, code may
- > -- run (just) a little bit faster than ARRAY.
- 8a10,12
- > -- Note: a FIXED_ARRAY as only two attributes it save
- > -- a little bit memory too :-)
- > --
- 10c14,17
- < inherit COLLECTION[E];
- ---
- > inherit
- > COLLECTION[E]
- > redefine is_equal, fast_nb_occurrences, all_cleared
- > end;
- 89a97,157
- > feature -- Looking and comparison :
- >
- > is_equal(other: like Current): BOOLEAN is
- > -- Use `equal' to compare elements.
- > local
- > i: INTEGER;
- > e1, e2: E;
- > do
- > if Current = other then
- > Result := true;
- > elseif upper = other.upper then
- > from
- > Result := true;
- > i := upper;
- > until
- > i < 0 or not Result
- > loop
- > Result := equal_like(item(i),other.item(i));
- > i := i - 1;
- > end;
- > end;
- > end;
- >
- > all_cleared: BOOLEAN is
- > -- Are all items set to default values?
- > local
- > value: E;
- > i: INTEGER;
- > do
- > from
- > Result := true;
- > i := upper;
- > until
- > i < lower
- > loop
- > Result := value = item(i);
- > if Result then
- > i := i - 1;
- > else
- > i := -1;
- > end;
- > end;
- > end;
- >
- > fast_nb_occurrences(elt: E): INTEGER is
- > -- Number of occurrences using `='.
- > local
- > i: INTEGER;
- > do
- > from
- > i := upper;
- > until
- > i < 0
- > loop
- > if elt = item(i) then
- > Result := Result + 1;
- > end;
- > i := i - 1;
- > end;
- > end;
- >
- diff -r lib_std/fixed_array.e /users/prof/colnet/SmallEiffel/lib_std/fixed_array.elib_std/general.e /users/prof/colnet/SmallEiffel/lib_std/general.e
- 68,69c68
- < if is_expanded_type then
- < else
- ---
- > if not is_expanded_type then
- 77,91d75
- < frozen new_same_type(other: GENERAL): BOOLEAN is
- < -- Is type of current object identical to type of other.
- < require
- < other_not_void: other /= Void;
- < do
- < if is_expanded_type then
- < -- *** Could write not is_expanded !!
- < else
- < c_inline_c("R=(C->id)==(a1->id);");
- < end;
- < ensure
- < definition: Result = (conforms_to(other) and
- < other.conforms_to(Current));
- < end;
- <
- 185c169
- < c_inline_c("R=(T0 *)new(a1->id);");
- ---
- > c_inline_c("R=(T0 *)se_new(a1->id);");
- 225c209
- < c_inline_c("R=(T0 *)new(a1->id);%N%
- ---
- > c_inline_c("R=(T0 *)se_new(a1->id);%N%
- 374c358
- < %fclose(f);}");
- ---
- > %if (R) fclose(f);}");
- diff -r lib_std/general.e /users/prof/colnet/SmallEiffel/lib_std/general.elib_std/std_file.e /users/prof/colnet/SmallEiffel/lib_std/std_file.e
- 39d38
- < path /= Void;
- 69c68
- < fclose (stream_pointer : POINTER): INTEGER is
- ---
- > fclose(stream_pointer : POINTER): INTEGER is
-